'use strict';  
  
/* Services- 修改url，不执行route的path */
app.service('locationChanger', ['$location', '$route', '$rootScope', function ($location, $route, $rootScope) {
    this.skipReload = function () {
        var lastRoute = $route.current;
        $rootScope.$on('$locationChangeSuccess', function () {
            $route.current = lastRoute;
        });
        return this;
    };

    this.withoutRefresh = function (url, doesReplace) {
        if(doesReplace){
            $location.path(url).replace();
        }
        else {
            $location.path(url || '/');
        }
    };
}]);
// locationChanger.skipReload().withoutRefresh("/", true);
